package com.sayimo.maker.mall.orders.dao.impl;


import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.sayimo.framework.database.mybatis.AbstractMybatisBaseDao;
import com.sayimo.framework.exception.DaoException;
import com.sayimo.maker.mall.orders.dao.OrderPeriodInterfaceDao;
import com.sayimo.maker.mall.orders.vo.OrderPeriod;



/**
 * @Project: schoolmallapi
 * @ClassName: OrderPeriodInterfaceImplDao
 * @Description: 预约时间
 * @Author: 曹频辉
 * @Date: 2016年1月8日
 * @Version 1.0
 */
@Repository(value="orderPeriodInterfaceImplDao")
public class OrderPeriodInterfaceImplDao extends AbstractMybatisBaseDao<OrderPeriod> implements OrderPeriodInterfaceDao{
	
	
	/**
	 * 
	* @Title: getOrderTemplateByGoodsId 
	* @Description: 获取商品的预约时间模板
	* @param goodsId
	* @return
	* @throws DaoException
	* @return Map
	* @throws
	 */
	@Override
	public Map getOrderTemplateByGoodsId(Integer goodsId) throws DaoException {
		return (Map)this.mybatisInterfaceBaseDao.getObject("com.sayimo.maker.mall.orders.dao.OrderPeriodInterfaceDao.getOrderTemplateByGoodsId", goodsId);
	}
	
	/**
	 * 
	* @Title: getOrderPeriodsByTemplateId 
	* @Description: 获取模板的所有预约时间段
	* @param id
	* @return
	* @throws DaoException
	* @return List
	* @throws
	 */
	@Override
	public List getOrderPeriodsByTemplateId(Integer id) throws DaoException {
		return this.mybatisInterfaceBaseDao.queryObject("com.sayimo.maker.mall.orders.dao.OrderPeriodInterfaceDao.getOrderPeriodsByTemplateId", id);
	}

	@Override
	public Map<String, Object> queryOrderPeriodByPeriodId(Integer id) throws DaoException {
		return mybatisInterfaceBaseDao.queryMap("com.sayimo.maker.mall.orders.dao.OrderPeriodInterfaceDao.queryOrderPeriodByPeriodId", "id", id);
	}
	
	
	
}
